//
//  WNTestViewController.swift
//  WNWeibo
//
//  Created by 风不会停息 on 2017/7/22.
//  Copyright © 2017年 风不会停息. All rights reserved.
//

import UIKit

class WNTestViewController: UIViewController,UIGestureRecognizerDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.navigationController?.interactivePopGestureRecognizer?.delegate = self
        
        view.backgroundColor = UIColor.white

        setupPushButton()
    }

    //  设置导航栏push按钮
    private func setupPushButton() {
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "push", target: self, action: #selector(pushAction))
    }
    
    //  MARK: --    push按钮事件
    @objc private func pushAction() {
        let testVC = WNTestViewController()
        self.navigationController?.pushViewController(testVC, animated: true)
        
//        testVC.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "back", target: self, action: #selector(back))
        
        testVC.navigationItem.backBarButtonItem = UIBarButtonItem(title: "back", target: self, action: #selector(back))

    }
    
    func back()
    {
        self.navigationController?.popViewController(animated: true)
    }
    
    
    

}
